load("@rules_cc//cc:defs.bzl", "cc_test")
load("//bazel:copts.bzl", "copts")
load("//bazel:malloc.bzl", "malloc")

cc_test(
    name = "protobuf",
    srcs = [
        "collect.cc",
    ],
    copts = copts(),
    malloc = malloc(),
    deps = [
        "//eventuals/protobuf",
        "@com_github_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ] + select(
        {
            # We support backward lib only for Linux.
            # The support for Windows and MacOS might be added in future.
            # https://github.com/3rdparty/eventuals/issues/450
            # https://github.com/3rdparty/eventuals/issues/616
            "@platforms//os:linux": [
                "@com_github_3rdparty_bazel_rules_backward_cpp_stacktrace//:backward-stacktrace",
            ],
            "//conditions:default": [],
        },
    ),
)
